<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
    window.onload=function(){
        document.getElementById("name").onblur=function(){
            //判断用户名是否被使用过，给出提示.发送同步请求
            window.location.href="<c:url value='/UserExistsServlet?name='/>"+
                    document.getElementById("name").value;
        };

    };
</script>
</head>
<body>
<!-- 前端验证当前页面JS代码,后端RegistServlet调用Service方法之前验证 -->
<form action="<c:url value='/RegistServlet'/>">
    用户名：<input type="text" name="name" id="name"/>${ namemsg}<br/>
    密码：<input type="text" name="pwd"/><br/>
    <input type="submit" value="注册"/><br/>
</form>
</body>
</html>